Integrand size = 33, antiderivative size = 172 \[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=-\frac {2 \left (10 a A b+5 a^2 B+3 b^2 B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (3 a^2 A+A b^2+2 a b B\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 b^2 B \sin (c+d x)}{5 d \cos ^{\frac {5}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 \left (10 a A b+5 a^2 B+3 b^2 B\right ) \sin (c+d x)}{5 d \sqrt {\cos (c+d x)}} \]
[Out]
Time = 0.47 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {3033, 3067, 3100, 2827, 2716, 2719, 2720} \[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=\frac {2 \left (3 a^2 A+2 a b B+A b^2\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}-\frac {2 \left (5 a^2 B+10 a A b+3 b^2 B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (5 a^2 B+10 a A b+3 b^2 B\right ) \sin (c+d x)}{5 d \sqrt {\cos (c+d x)}}+\frac {2 b (2 a B+A b) \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 b^2 B \sin (c+d x)}{5 d \cos ^{\frac {5}{2}}(c+d x)} \]
[In]
[Out]
Rule 2716
Rule 2719
Rule 2720
Rule 2827
Rule 3033
Rule 3067
Rule 3100
Rubi steps \begin{align*} \text {integral}& = \int \frac {(b+a \cos (c+d x))^2 (B+A \cos (c+d x))}{\cos ^{\frac {7}{2}}(c+d x)} \, dx \\ & = \frac {2 b^2 B \sin (c+d x)}{5 d \cos ^{\frac {5}{2}}(c+d x)}-\frac {2}{5} \int \frac {-\frac {5}{2} b (A b+2 a B)-\frac {1}{2} \left (10 a A b+5 a^2 B+3 b^2 B\right ) \cos (c+d x)-\frac {5}{2} a^2 A \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x)} \, dx \\ & = \frac {2 b^2 B \sin (c+d x)}{5 d \cos ^{\frac {5}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}-\frac {4}{15} \int \frac {-\frac {3}{4} \left (10 a A b+5 a^2 B+3 b^2 B\right )-\frac {5}{4} \left (3 a^2 A+A b^2+2 a b B\right ) \cos (c+d x)}{\cos ^{\frac {3}{2}}(c+d x)} \, dx \\ & = \frac {2 b^2 B \sin (c+d x)}{5 d \cos ^{\frac {5}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}-\frac {1}{3} \left (-3 a^2 A-A b^2-2 a b B\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx-\frac {1}{5} \left (-10 a A b-5 a^2 B-3 b^2 B\right ) \int \frac {1}{\cos ^{\frac {3}{2}}(c+d x)} \, dx \\ & = \frac {2 \left (3 a^2 A+A b^2+2 a b B\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 b^2 B \sin (c+d x)}{5 d \cos ^{\frac {5}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 \left (10 a A b+5 a^2 B+3 b^2 B\right ) \sin (c+d x)}{5 d \sqrt {\cos (c+d x)}}-\frac {1}{5} \left (10 a A b+5 a^2 B+3 b^2 B\right ) \int \sqrt {\cos (c+d x)} \, dx \\ & = -\frac {2 \left (10 a A b+5 a^2 B+3 b^2 B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (3 a^2 A+A b^2+2 a b B\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 b^2 B \sin (c+d x)}{5 d \cos ^{\frac {5}{2}}(c+d x)}+\frac {2 b (A b+2 a B) \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 \left (10 a A b+5 a^2 B+3 b^2 B\right ) \sin (c+d x)}{5 d \sqrt {\cos (c+d x)}} \\ \end{align*}
Time = 2.26 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.02 \[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=\frac {-6 \left (10 a A b+5 a^2 B+3 b^2 B\right ) \cos ^{\frac {3}{2}}(c+d x) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+10 \left (3 a^2 A+A b^2+2 a b B\right ) \cos ^{\frac {3}{2}}(c+d x) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+10 A b^2 \sin (c+d x)+20 a b B \sin (c+d x)+30 a A b \sin (2 (c+d x))+15 a^2 B \sin (2 (c+d x))+9 b^2 B \sin (2 (c+d x))+6 b^2 B \tan (c+d x)}{15 d \cos ^{\frac {3}{2}}(c+d x)} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(722\) vs. \(2(208)=416\).
Time = 21.69 (sec) , antiderivative size = 723, normalized size of antiderivative = 4.20
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.12 (sec) , antiderivative size = 286, normalized size of antiderivative = 1.66 \[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=-\frac {5 \, \sqrt {2} {\left (3 i \, A a^{2} + 2 i \, B a b + i \, A b^{2}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 5 \, \sqrt {2} {\left (-3 i \, A a^{2} - 2 i \, B a b - i \, A b^{2}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 3 \, \sqrt {2} {\left (5 i \, B a^{2} + 10 i \, A a b + 3 i \, B b^{2}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + 3 \, \sqrt {2} {\left (-5 i \, B a^{2} - 10 i \, A a b - 3 i \, B b^{2}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) - 2 \, {\left (3 \, B b^{2} + 3 \, {\left (5 \, B a^{2} + 10 \, A a b + 3 \, B b^{2}\right )} \cos \left (d x + c\right )^{2} + 5 \, {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{15 \, d \cos \left (d x + c\right )^{3}} \]
[In]
[Out]
\[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=\int \frac {\left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2}}{\sqrt {\cos {\left (c + d x \right )}}}\, dx \]
[In]
[Out]
\[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=\int { \frac {{\left (B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )}^{2}}{\sqrt {\cos \left (d x + c\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=\int { \frac {{\left (B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )}^{2}}{\sqrt {\cos \left (d x + c\right )}} \,d x } \]
[In]
[Out]
Time = 17.88 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.32 \[ \int \frac {(a+b \sec (c+d x))^2 (A+B \sec (c+d x))}{\sqrt {\cos (c+d x)}} \, dx=\frac {6\,B\,b^2\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {5}{4},\frac {1}{2};\ -\frac {1}{4};\ {\cos \left (c+d\,x\right )}^2\right )+30\,B\,a^2\,{\cos \left (c+d\,x\right )}^2\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{4};\ {\cos \left (c+d\,x\right )}^2\right )+20\,B\,a\,b\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {3}{4},\frac {1}{2};\ \frac {1}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{15\,d\,{\cos \left (c+d\,x\right )}^{5/2}\,\sqrt {1-{\cos \left (c+d\,x\right )}^2}}+\frac {2\,A\,a^2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,A\,b^2\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {3}{4},\frac {1}{2};\ \frac {1}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{3\,d\,{\cos \left (c+d\,x\right )}^{3/2}\,\sqrt {{\sin \left (c+d\,x\right )}^2}}+\frac {4\,A\,a\,b\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{d\,\sqrt {\cos \left (c+d\,x\right )}\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \]
[In]
[Out]